package com.gy.bearhelps.setting.util;

import android.app.AlertDialog;
import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.gy.bearhelps.R;
import com.gy.bearhelps.util.ListViewItemListener;

/**
 * Created by 高岳 on 2016/11/14.
 * Describe:
 */
public class DialogUtil {

    /** 购物车选择删除收藏dialog*/
    public static void showSelectShopcarDialog(final Context context, final int index, final ListViewItemListener listener) {
        final AlertDialog alertDialog = new AlertDialog.Builder(context).create();
        View view = View.inflate(context, R.layout.dialog_shopcar_select, null);

        alertDialog.setCancelable(true);
        alertDialog.show();
        alertDialog.getWindow().setContentView(view);
        alertDialog.setCanceledOnTouchOutside(true);

        TextView tvDelete = (TextView) view.findViewById(R.id.dialog_shopcar_select_tv_delete);
        tvDelete.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                listener.doPassActionListener(null,0,index,"");
                alertDialog.dismiss();
            }
        });
    }
}
